<?php

namespace app\web\model;
use think\Model;
use think\Db;

class LineMemberModel extends Model
{
    protected $name = 'line_member';
    
    // 开启自动写入时间戳
    protected $autoWriteTimestamp = false;
	//线下会员支付日志
	function add_line_paylog($param){
		$data = array(
			'type' 			=> $param['type'],
			'sn' 			=> $param['sn'],
			'price' 		=> $param['price'],
			'pay_method' 		=> $param['pay_method'],
			'agent_id'		=> $param['agent_id'],
			'line_member_id'=> $param['line_member_id'],
			'pay_money'			=> $param['pay_money'] ,
			'add_time' 		=> 	now_time(),
			'zs_score'		=>$param['zs_score'],
			'status'		=>$param['status']
		);
		if(isset($param['house_id'])){
			$data['house_id']=$param['house_id'];
		}
		if(isset($param['coupon_id'])){
			$data['coupon_id']=$param['coupon_id'];
		}
		$res=db("line_paylog")->insert($data);
		return $res;
	}
}